package com.netease.research.dao;

import com.netease.research.pojo.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    //    Create By WYS
    Cart selectByProductIdUserId(@Param("productId") Integer productId, @Param("userId") Integer userId);

    int updateQuantityByPrimaryKey(@Param("id") Integer id, @Param("quantity") Integer quantity);

    List<Cart> selectByUserId(Integer userId);

    void deleteByUserId(Integer userId);
}